#  Lindsay Ergenekan 
#  ergenekl@onid.oregonstate.edu
#  CS311-400
#  Homework5 
#
#  $RCSfile$
#  $Revision$
#  $Author$
#  $Date$
#  $Log$
#

CC=gcc
DEBUG=-g
CFLAGS=$(DEBUG) -Wall -std=c99 -Wshadow -Wunreachable-code -Wmissing-declarations -Wold-style-definition -Wmissing-prototypes -Wdeclaration-after-statement
PROGS= uniquify 

all: $(PROGS)


test: uniquify.o
	@echo TEST UNIQUIFY
	@rm -f outfile1
	@rm -f BASHoutfile1
	@rm -f outfile2
	@rm -f BASHoutfile2
	@rm -f outfile3
	@rm -f BASHoutfile3
	@rm -f outfile4
	@rm -f BASHoutfile4
	@rm -f outfile5
	@rm -f BASHoutfile5
	@sh uniquify.bash < test.txt > BASHoutfile1
	@./uniquify -n 20 <test.txt > outfile1
	diff BASHoutfile1 outfile1
	
vimtest: uniquify.o
	@echo TEST UNIQUIFY
	@rm -f outfile1
	@rm -f BASHoutfile1
	@rm -f outfile2
	@rm -f BASHoutfile2
	@rm -f outfile3
	@rm -f BASHoutfile3
	@rm -f outfile4
	@rm -f BASHoutfile4
	@rm -f outfile5
	@rm -f BASHoutfile6
	@sh uniquify.bash < test.txt > BASHoutfile1
	@./uniquify -n 20 <test.txt > outfile1
	vimdiff BASHoutfile1 outfile1

uniquify: uniquify.o
	$(CC) $(CFLAGS) -o uniquify uniquify.o hw5.h  

uniquify.o: uniquify.c
	$(CC) $(CFLAGS) -c uniquify.c 


clean:
	rm -f $(PROGS) *.o *~

